package top.kaoshanji.p1ch04a;

/**
 * 代码清单-p1ch04a-88页a：演示继承原理：Base类
 * author kaoshanji
 * ^_^
 * create time 2025/2/17 16:12
 */
public class Base {

    public static int s;
    private int a;

    static {
        System.out.println("基类静态代码块，s：" + s);
        s = 1;
    }

    {
        System.out.println("基类实例代码块，a：" + a);
        a = 1;
    }

    public Base() {
        System.out.println("基类构造方法，a：" + a);
        a = 2;
    }

    protected void step() {
        System.out.println("base s:" + s + ", a: " + a);
    }

    public void action() {
        System.out.println("start");
        step();
        System.out.println("end");
    }

}
